package com.example.schoolguider.service;

import com.example.schoolguider.mapper.PointMapper;
import com.example.schoolguider.model.Point;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wjc
 * @date 2024/6/30 9:41
 */
@Service
public class PointService {
    @Autowired
    PointMapper pointMapper;

    public List<Point> listPointsByAreaId(Long areaId) {
        return pointMapper.selectAllPointsByAreaId(areaId);
    }

    public boolean addPoint(Point point) {
        return pointMapper.insertPoint(point);
    }

    public boolean updatePoint(Point point) {
        return pointMapper.updatePoint(point);
    }

    public Point getPointById(Long pointId) {
        return pointMapper.selectPointById(pointId);
    }
}
